package com.leyou.item.api;

import com.leyou.item.entity.SpecGroup;
import com.leyou.item.entity.SpecParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author linzx
 * @date 2020/3/26
 */
public interface SpecificationApi {

    /**
     * 根据参数查找SpecParam
     * @param cid
     * @param gid
     * @param searching
     * @return
     */
    @GetMapping("spec/params")
    List<SpecParam> findSpecByParams(
            @RequestParam(value = "cid", required = false) Long cid,
            @RequestParam(value = "gid", required = false) Long gid,
            @RequestParam(value = "searching", required = false) Boolean searching
    ) ;

    /**
     * 根据cid查找SpecGroup
     * @param cid
     * @return
     */
    @GetMapping("spec/groups/{cid}")
    List<SpecGroup> findSpecGroupByCid(@PathVariable("cid") Long cid);



}
